<script setup>
defineProps({
  // 匿名v-model
  modelValue: String,
  // 具名v-model:count
  count: Number
})
const emit = defineEmits(['update:modelValue', 'update:count'])

const changeMsg = () => {
  // 匿名v-model
  emit('update:modelValue', 'hello world')
  // 具名v-model:count
  emit('update:count', 666)
}
</script>

<template>
  <div class="box">
    测试组件的双向绑定
    {{ modelValue }}
    {{ count }}
    <button @click="changeMsg">改变</button>
  </div>
</template>

<style lang="scss" scoped></style>
